from django.db import models


class User(models.Model):
    uid = models.AutoField(primary_key=True)
    state = models.IntegerField()
    name = models.CharField(max_length=20)
    sid = models.CharField(max_length=45)
    password = models.CharField(max_length=45, db_column='pwd')
    college = models.IntegerField(blank=True, null=True)
    class_field = models.IntegerField(db_column='class_', blank=True,
                                      null=True)  # Field renamed because it ended with '_'.
    face = models.TextField(blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'user'


class College(models.Model):
    college_id = models.IntegerField(primary_key=True)
    college_name = models.CharField(max_length=45)

    class Meta:
        managed = False
        db_table = 'college'

class Class(models.Model):
    class_id = models.IntegerField(primary_key=True)
    class_name = models.CharField(max_length=20)
    number = models.IntegerField()
    college_id = models.IntegerField()

    class Meta:
        managed = False
        db_table = 'class_'